/********************************************************************
* FileName:      HardwareProfile.h

********************************************************************/

#ifndef _HARDWARE_PROFILE_H
    #define _HARDWARE_PROFILE_H
    
    #include "GenericTypeDefs.h"
    #include "ConfigApp.h"
    
    /*********************************************************************/
    // Choose one of the demo board that support the demo out of the box
    /*********************************************************************/
    //#define PICDEMZ
   // #define PIC18_EXPLORER
    #define EXPLORER16
    //#define EIGHT_BIT_WIRELESS_BOARD

    // there are three ways to use NVM to store data: External EPROM, Data EEPROM and 
    // programming space, with following definitions:
    //  #define USE_EXTERNAL_EEPROM
    //  #define USE_DATA_EEPROM
    //  #define USE_PROGRAMMING_SPACE  
    // Each demo board has defined the method of using NVM, as
    // required by Network Freezer feature.
    

 
         
        #define RFIF            IFS1bits.INT1IF
        #define RFIE            IEC1bits.INT1IE
        #define CLOCK_FREQ      20000000
    
        #define RF_INT_PIN      PORTDbits.RD8
        #define RF_INT_TRIS     TRISDbits.TRISD8
       
        #define USE_EXTERNAL_EEPROM
        
        
        // Transceiver Configuration
   
     //   #define PHY_CS              LATCbits.LATC14
     //   #define PHY_CS_TRIS         TRISCbits.TRISC14
        #define PHY_CS              LATDbits.LATD9   //A
        #define PHY_CS_TRIS         TRISDbits.TRISD9 //A
        #define PHY_RESETn          LATEbits.LATE2
        #define PHY_RESETn_TRIS     TRISEbits.TRISE2
      

        #define SPI_SDI             PORTFbits.RF2
        #define SDI_TRIS            TRISFbits.TRISF2
        #define SPI_SDO             LATFbits.LATF3 
        #define SDO_TRIS            TRISFbits.TRISF3
        #define SPI_SCK             LATFbits.LATF6 
        #define SCK_TRIS            TRISFbits.TRISF6
        
        #define PHY_WAKE            LATEbits.LATE1
        #define PHY_WAKE_TRIS       TRISEbits.TRISE1
   
        #define PUSH_BUTTON_1       PORTDbits.RD6
        #define PUSH_BUTTON_2       PORTDbits.RD7
        #define LED_1               LATEbits.LATE4
        #define LED_2               LATEbits.LATE3
	#define MEM_WC              LATBbits.LATB12
        #define RX                  PORTDbits.RD10

        #define BUTTON_1_TRIS       TRISDbits.TRISD6
        #define BUTTON_2_TRIS       TRISDbits.TRISD7
        #define LED_1_TRIS          TRISEbits.TRISE4
        #define LED_2_TRIS          TRISEbits.TRISE3
        #define MEM_WC_TRIS         TRISBbits.TRISB12
        #define RX_TRIS             TRISDbits.TRISD10

        // Define SUPPORT_TWO_SPI if external EEPROM use the second SPI
        // port alone, not sharing SPI port with the transceiver
        #define SUPPORT_TWO_SPI
        
        // External EEPROM SPI chip select pin definition
        #define EE_nCS_TRIS         TRISEbits.TRISE5
        #define EE_nCS              LATEbits.LATE5
        
        #define TMRL TMR2
  
    
    // Following definition is for delay functionality
    
        #define GetInstructionClock()   (CLOCK_FREQ/2)
  

    BYTE ButtonPressed(void);
    void BoardInit(void);

   

    
#endif
